package net.devh.examples.grpc.cloud;


import io.grpc.stub.StreamObserver;
import ldy.test.UserReply;
import ldy.test.UserRequest;
import ldy.test.UserServiceGrpc;
import net.devh.examples.grpc.lib.HelloReply;
import net.devh.examples.grpc.lib.HelloRequest;
import net.devh.examples.grpc.lib.SimpleGrpc;
import net.devh.springboot.autoconfigure.grpc.server.GrpcService;

/**
 * User: Michael
 * Email: yidongnan@gmail.com
 * Date: 2016/11/8
 */

@GrpcService(UserServiceGrpc.class)
public class GrpcUserService extends UserServiceGrpc.UserServiceImplBase {

    @Override
    public void addUser(UserRequest request, StreamObserver<UserReply> responseObserver) {
        UserReply reply = UserReply.newBuilder().setFlag(1).setDetail("success").build();
        responseObserver.onNext(reply);
        responseObserver.onCompleted();
    }

    @Override
    public void updateUser(UserRequest request, StreamObserver<UserReply> responseObserver) {
        super.updateUser(request, responseObserver);
    }

    @Override
    public void delUser(UserRequest request, StreamObserver<UserReply> responseObserver) {
        super.delUser(request, responseObserver);
    }
}
